import request from '@/config/axios'

// 班级和老师关联 VO
export interface ClassesTeacherVO {
  id: number // 编号
  classId: number // 班级ID
  className: string //班级名称
  teacherId: number // 教师ID
  teacherName: string //教师姓名
  post: number // 教师职务
}

// 班级和老师关联 API
export const ClassesTeacherApi = {
  // 查询班级和老师关联分页
  getClassesTeacherPage: async (params: any) => {
    return await request.get({ url: `/school/classes-teacher/page`, params })
  },

  // 查询班级老师列表
  getClassesTeacherList: async (classId: number) => {
    return await request.get({ url: `/school/classes-teacher/simple-list?classId=` + classId })
  },

  // 查询班级和老师关联详情
  getClassesTeacher: async (id: number) => {
    return await request.get({ url: `/school/classes-teacher/get?id=` + id })
  },

  // 新增班级和老师关联
  createClassesTeacher: async (data: ClassesTeacherVO) => {
    return await request.post({ url: `/school/classes-teacher/create`, data })
  },

  // 修改班级和老师关联
  updateClassesTeacher: async (data: ClassesTeacherVO) => {
    return await request.put({ url: `/school/classes-teacher/update`, data })
  },

  // 删除班级和老师关联
  deleteClassesTeacher: async (id: number) => {
    return await request.delete({ url: `/school/classes-teacher/delete?id=` + id })
  },

  // 导出班级和老师关联 Excel
  exportClassesTeacher: async (params) => {
    return await request.download({ url: `/school/classes-teacher/export-excel`, params })
  }
}
